package com.project.server.domain.visitorRecord;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.project.common.annotation.Excel;
import com.project.common.annotation.Excel.Type;
import com.project.common.core.domain.BaseEntity;
import com.project.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 访客记录信息表
 *
 * @author admin
 */
public class TVisitorRecord extends BaseEntity {

    /**
     * 访客记录id
     */
    private Long visitId;

    /**
     * 访客微信openid
     */
    private String openId;

    /**
     * 访客姓名
     */
    @Excel(name = "访客姓名")
    @NotBlank(message = "访客姓名不能为空")
    @Size(min = 0, max = 30, message = "姓名长度不能超过30个字符")
    private String visitName;

    /**
     * 访客电话
     */
    @Excel(name = "访客电话")
    @NotBlank(message = "访客电话不能为空")
    private String visitPhone;

    /**
     * 访客身份证
     */
    @Excel(name = "访客身份证")
    @NotBlank(message = "访客身份证不能为空")
    private String visitCard;

    /**
     * 访客性别
     */
    @Excel(name = "访客性别", readConverterExp = "0=男,1=女,2=未知")
    private String visitSex;

    /**
     * 访客年龄
     */
    @Excel(name = "访客年龄")
    private Integer visitAge;

    /**
     * 访客体温
     */
    @Excel(name = "访客体温")
    private double visitTemperature;

    /**
     * 企业id
     */
    private Long compId;
    
    /**
     * 访问企业名称
     */
    @Excel(name = "访问企业名称")
    private String visitComp;

    /**
     * 访问时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "访问时间")
    private Date visitTime;

    /**
     * 访问事由
     */
    @Excel(name = "访问事由")
    private String visitMatter;

    /**
     * 接待人id
     */
    private Long userId;

    /**
     * 用户对象
     */
    @Excel(name = "接待人姓名", targetAttr = "userName", type = Type.EXPORT)
    private SysUser user;

    /**
     * 离开时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "离开时间")
    private Date leftTime;
    
    /**
     * 审批人id
     */
    private Long approverId;

    /**
     * 审批时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
    private Date approverTime;

    /**
     * 审批状态
     */
    @Excel(name = "审批状态", readConverterExp = "0=待审批,1=通过,2=拒绝,3=自动通过")
    private String approverState;


    public SysUser getUser() {
        return user;
    }

    public void setUser(SysUser user) {
        this.user = user;
    }

    public Long getVisitId() {
        return visitId;
    }

    public void setVisitId(Long visitId) {
        this.visitId = visitId;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getVisitName() {
        return visitName;
    }

    public void setVisitName(String visitName) {
        this.visitName = visitName;
    }

    public String getVisitPhone() {
        return visitPhone;
    }

    public void setVisitPhone(String visitPhone) {
        this.visitPhone = visitPhone;
    }

    public String getVisitCard() {
        return visitCard;
    }

    public void setVisitCard(String visitCard) {
        this.visitCard = visitCard;
    }

    public String getVisitSex() {
        return visitSex;
    }

    public void setVisitSex(String visitSex) {
        this.visitSex = visitSex;
    }

    public Integer getVisitAge() {
        return visitAge;
    }

    public void setVisitAge(Integer visitAge) {
        this.visitAge = visitAge;
    }

    public Long getCompId() {
        return compId;
    }

    public void setCompId(Long compId) {
        this.compId = compId;
    }

    public String getVisitComp() {
        return visitComp;
    }

    public void setVisitComp(String visitComp) {
        this.visitComp = visitComp;
    }

    public double getVisitTemperature() {
        return visitTemperature;
    }

    public void setVisitTemperature(double visitTemperature) {
        this.visitTemperature = visitTemperature;
    }

    public String getVisitMatter() {
        return visitMatter;
    }

    public void setVisitMatter(String visitMatter) {
        this.visitMatter = visitMatter;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getApproverId() {
        return approverId;
    }

    public void setApproverId(Long approverId) {
        this.approverId = approverId;
    }

    public Date getApproverTime() {
        return approverTime;
    }

    public void setApproverTime(Date approverTime) {
        this.approverTime = approverTime;
    }

    public String getApproverState() {
        return approverState;
    }

    public void setApproverState(String approverState) {
        this.approverState = approverState;
    }

    public Date getVisitTime() {
        return visitTime;
    }

    public void setVisitTime(Date visitTime) {
        this.visitTime = visitTime;
    }

    public Date getLeftTime() {
        return leftTime;
    }

    public void setLeftTime(Date leftTime) {
        this.leftTime = leftTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("visitId", getVisitId())
                .append("openId", getOpenId())
                .append("visitName", getVisitName())
                .append("visitPhone", getVisitPhone())
                .append("visitCard", getVisitCard())
                .append("visitSex", getVisitSex())
                .append("visitAge", getVisitAge())
                .append("visitTemperature", getVisitTemperature())
                .append("compId", getCompId())
                .append("visitComp", getVisitComp())
                .append("visitTime",getVisitTime())
                .append("visitMatter", getVisitMatter())
                .append("userId", getUserId())
                .append("leftTime",getLeftTime())
                .append("approverId", getApproverId())
                .append("approverTime", getApproverTime())
                .append("approverState", getApproverState())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .append("user", getUser())
                .toString();

    }
}
